home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / msdos / raytrace / pov / gen / xtal4pov / xtal4pov.c < prev    next >
C/C++ Source or Header  |  1994-09-10  |  20KB  |  714 lines

  1. /* Crystal Shape Generator for POVRay 2.x, Ver. 2.0 */
  2. /* Klaus Kosten  Inst. f. Kristallographie der RWTH Aachen 22.05.94 */
  3.  
  4.  
  5. #include "STDIO.H"
  6. #include "MATH.H"
  7.  
  8. #define True 1
  9. #define False 0
  10.  
  11. FILE *daten;
  12.  
  13. void klasse_lesen(void);
  14. void lesen(void);
  15. void laden(void);
  16. void erzeugen(void);
  17. void pruefen(void);
  18. void skalieren(void);
  19. void hextrans(void);
  20. void monotrans(void);
  21. void tritrans(void);
  22. void notrans(void);
  23. void anfang(void);
  24. void schreiben(void);
  25. void ende(void);
  26.  
  27. /* Tabelle der Punktgruppen */
  28. short int MatAnz;
  29. short int krsys;
  30.  
  31. short int Temp[3];
  32. short int Generator[5][3][3];
  33. short int Form[48][3];
  34. short int Zeiger, h, i, j, k, l, m;
  35. short int Flag, Klasse, *PGMat;
  36. char PGr[6], PG[16];
  37. float b, c, d, e, f, scale;
  38. float OutForm[48][3];
  39.  
  40.  
  41.  
  42. main() {
  43.  
  44.        printf("XTAL4POV 2.0\n");
  45.        printf("Crystal Shape Generator for POV-Ray 2.x\n\n");
  46.        printf("K. Kosten   Institut für Kristallographie   RWTH Aachen ");
  47.        printf(" 22.05.94 \n\n\n");
  48.  
  49.        /* Kristallklasse lesen und Matrix erzeugen */
  50.        klasse_lesen();
  51.        laden();
  52.        anfang();
  53.  
  54.        do {
  55.  
  56.        for(h=0; h<48; h++) {       /* Form initialisieren */
  57.                for(i=0; i<3; i++) {
  58.                        Form[h][i] = 0;
  59.                }
  60.        }
  61.        lesen();                /* Miller-Indices laden */
  62.        if (Form[0][0] >= 99)
  63.                break;
  64.  
  65.        Zeiger = 1;
  66.        Flag = False;
  67.  
  68.        if (MatAnz > 0) {
  69.            erzeugen();
  70.        }
  71.  
  72.        switch (krsys) {
  73.                case 1: tritrans();
  74.                        break;
  75.                case 2: monotrans();
  76.                        break;
  77.                case 5:
  78.                case 6: hextrans();
  79.                        break;
  80.              default : notrans();
  81.        }
  82.  
  83.        skalieren();
  84.  
  85.        for (h = 0; h < Zeiger; h++) {
  86.            for (i = 0; i < 3; i++) {
  87.                printf("%6d", Form[h][i]);
  88.            }
  89.            printf("\n");
  90.        }
  91.        printf("%d Faces calculated\n\n", Zeiger);
  92.        printf("Crystal Class:  %s\n", PGr);
  93.        printf("Scale factor:  %8.4f\n", scale);
  94.  
  95.        schreiben();
  96.  
  97.        } while(Form[0][0] < 99);
  98.  
  99.        ende();
  100.  
  101. }
  102.  
  103.  
  104.  
  105.  
  106.  
  107. void klasse_lesen(void) {
  108.  
  109.        printf("The following crystal class symbols may be used:\n\n");
  110.        printf("Triclinic:\t1\t-1\n");
  111.        printf("Monoclinic:\t2\tm\t2/m\n");
  112.        printf("Orthorhombic:\t222\tmm2\tmmm\n");
  113.        printf("Tetragonal:\t4\t-4\t4/m\t422\t4mm\t-42m\t4/mmm\n");
  114.        printf("Trigonal:\t3\t-3\t32\t3m\t-3m\n");
  115.        printf("Hexagonal:\t6\t-6\t6/m\t622\t6mm\t-62m\t6/mmm\n");
  116.        printf("Cubic:\t\t23\tm-3\t432\t-43m\tm-3m\n\n");
  117.        printf("Please enter a symbol:   ");
  118.  
  119.        gets(PGr);
  120.  
  121. }
  122.  
  123. void lesen(void) {
  124.  
  125.        printf("\n\nPlease enter the Miller-Indices\n ");
  126.        printf("Format: h k l\n\n");
  127.        printf("( 99 0 0 ends ):\n");
  128.  
  129.        scanf("%d %d %d", &h, &k, &l);
  130.  
  131.        Form[0][0] = h;
  132.        Form[0][1] = k;
  133.        Form[0][2] = l;
  134. }
  135.  
  136. void skalieren(void) {
  137.  
  138.        b = fabs(OutForm[0][0]);
  139.        c = fabs(OutForm[0][1]);
  140.        d = fabs(OutForm[0][2]);
  141.  
  142.        scale = sqrt( (b * b) + (c * c) + (d * d) );
  143.  
  144.        e = (b > c ? b : c);
  145.        f = (e > d ? e : d);
  146.  
  147.        scale /= f;
  148.        scale = 1 / scale;
  149.  
  150. }
  151.  
  152. void hextrans(void) {
  153.  
  154. float trans[3][3];
  155. float b;
  156.  
  157.        for (h = 0; h < 3; h++) {
  158.                for (i = 0; i < 3; i++) {
  159.                        trans[h][i] = 0;
  160.                }
  161.        }
  162.        trans[0][0] = 1;
  163.        trans[0][1] = -.5;
  164.        trans[1][1] = .866;
  165.        trans[2][2] = 1;
  166.  
  167.        for (h = 0; h < Zeiger; h++) {
  168.                for (i = 0; i < 3; i++) {
  169.                        b = 0;
  170.                        for (j = 0; j < 3; j++) {
  171.                                b += Form[h][j] * trans[i][j];
  172.                        }
  173.                        OutForm[h][i] = b;
  174.                }
  175.        }
  176.  
  177. }
  178.  
  179. void monotrans(void) {
  180.  
  181.        notrans();
  182. }
  183.  
  184. void tritrans(void) {
  185.  
  186.        notrans();
  187. }
  188.  
  189. void notrans(void) {
  190.  
  191.        for (h = 0; h < Zeiger; h++) {
  192.                for (i = 0; i < 3; i++) {
  193.                        OutForm[h][i] = Form[h][i];
  194.                }
  195.        }
  196. }
  197.  
  198. void erzeugen(void) {
  199.  
  200.        do {
  201.            l = Zeiger;
  202.            for (m = 0; m < MatAnz; m++) {
  203.            for(j=0; j < Zeiger; j++) {   /* Matrixmultiplikation */
  204.                for (h = 0; h < 3; h++) {
  205.                    Temp[h] = 0;
  206.                }
  207.                for(h=0; h<3; h++) {
  208.                    for(i=0; i<3; i++) {
  209.                        Temp[h] += ( Generator[m][h][i] * Form[j][i] ) ;
  210.                    }
  211.                }
  212.                Flag = False;
  213.                pruefen();
  214.  
  215.                if ( Flag == False ) {
  216.                    for (h=0; h<3; h++) {
  217.                        Form[Zeiger][h] = Temp[h];
  218.                    }
  219.                    Zeiger++;
  220.                }
  221.            }
  222.            }
  223.        } while (l < Zeiger);
  224. }
  225.  
  226. void pruefen(void) {
  227.  
  228.        for(k=0; k < Zeiger; k++) {       /* Wert vorhanden ? */
  229.            i = 0;
  230.            for(h=0; h<3; h++) {
  231.                if ( Temp[h] == Form[k][h] )
  232.                    i++;
  233.            }
  234.            if (i == 3) {
  235.                Flag = True;
  236.            }
  237.        }
  238. }
  239.  
  240. void anfang(void) {
  241.  
  242.        daten = fopen ("crystal.inc","w");
  243.  
  244.        fprintf(daten, "/* Crystal Data for POVRay 2.x\n");
  245.        fprintf(daten, "   Generated by XTAL4POV 2.0\n\n");
  246.        fprintf(daten, "   Crystal Class %s\n", PGr);
  247.        fprintf(daten, "*/\n\n\n\n");
  248. }
  249.  
  250. void schreiben(void) {
  251.  
  252.         strcpy (PG, PGr);
  253.         strcat (PG, "_");
  254.  
  255.         for (h = 0; h < 16; h++)
  256.         { if (PG[h] == '-') PG[h] = '_';
  257.         }
  258.  
  259.  
  260.        fprintf(daten, "#declare %s", PG); 
  261.        for (h = 0; h < 3; h++) {
  262.             k = abs(Form[0][h]);
  263.             if (Form[0][h] < 0) {
  264.                 fprintf (daten, "_");
  265.             }
  266.             fprintf (daten, "%d", k);
  267.        }
  268.        fprintf (daten, " = intersection {\n");
  269.        for (h = 0; h < Zeiger; h++) {
  270.            fprintf(daten, "\tplane { < ");
  271.            fprintf(daten, " %6.3f,", OutForm[h][0]);
  272.            fprintf(daten, " %6.3f,", OutForm[h][1]);
  273.            fprintf(daten, " %6.3f", OutForm[h][2]);
  274.            fprintf(daten, " >, %6.3f }\n", scale);
  275.        }
  276.        fprintf(daten, "\n}\n\n\n");
  277. }
  278.  
  279. void ende(void) {
  280.  
  281.  
  282.        fclose(daten);
  283.  
  284.        printf("Crystal data were written to file CRYSTAL.INC\n\n");
  285.  
  286. }
  287.  
  288. /*  Definition of generator matrices */
  289.  
  290. static short int PGGen2[] = 
  291. {       -1, 0, 0, 0, -1, 0, 0, 0, -1 
  292. };
  293.  
  294. static short int PGGen3[] = 
  295. {        -1, 0, 0, 0, 1, 0, 0, 0, -1 
  296. };
  297.  
  298. static short int PGGen4[] = 
  299. {        1, 0, 0, 0, -1, 0, 0, 0, 1 
  300. };
  301.  
  302. static short int PGGen5[] = 
  303. {        -1, 0, 0, 0, 1, 0, 0, 0, -1, 
  304.         -1, 0, 0, 0, -1, 0, 0, 0, -1
  305. };
  306.  
  307. static short int PGGen6[] = 
  308. {        -1, 0, 0, 0, -1, 0, 0, 0, 1, 
  309.         -1, 0, 0, 0, 1, 0, 0, 0, -1
  310. };
  311.  
  312. static short int PGGen7[] = 
  313. {        -1, 0, 0, 0, -1, 0, 0, 0, 1, 
  314.         1, 0, 0, 0, -1, 0, 0, 0, 1
  315. };
  316.  
  317. static short int PGGen8[] = 
  318. {        -1, 0, 0, 0, -1, 0, 0, 0, 1, 
  319.         -1, 0, 0, 0, 1, 0, 0, 0, -1,
  320.         -1, 0, 0, 0, -1, 0, 0, 0, -1
  321. };
  322.  
  323. static short int PGGen9[] = 
  324. {        -1, 0, 0, 0, -1, 0, 0, 0, 1, 
  325.         0, -1, 0, 1, 0, 0, 0, 0, 1
  326. };
  327.  
  328. static short int PGGen10[] = 
  329. {        -1, 0, 0, 0, -1, 0, 0, 0, 1, 
  330.         0, 1, 0, -1, 0, 0, 0, 0, -1
  331. };
  332.  
  333. static short int PGGen11[] = 
  334. {        -1, 0, 0, 0, -1, 0, 0, 0, 1, 
  335.         0, -1, 0, 1, 0, 0, 0, 0, 1,
  336.         -1, 0, 0, 0, -1, 0, 0, 0, -1
  337. };
  338.  
  339. static short int PGGen12[] = 
  340. {        -1, 0, 0, 0, -1, 0, 0, 0, 1, 
  341.         0, -1, 0, 1, 0, 0, 0, 0, 1,
  342.         -1, 0, 0, 0, 1, 0, 0, 0, -1
  343. };
  344.  
  345. static short int PGGen13[] = 
  346. {        -1, 0, 0, 0, -1, 0, 0, 0, 1, 
  347.         0, -1, 0, 1, 0, 0, 0, 0, 1,
  348.         1, 0, 0, 0, -1, 0, 0, 0, 1
  349. };
  350.  
  351. static short int PGGen14[] = 
  352. {        -1, 0, 0, 0, -1, 0, 0, 0, 1, 
  353.         0, 1, 0, -1, 0, 0, 0, 0, -1,
  354.         -1, 0, 0, 0, 1, 0, 0, 0, -1
  355. };
  356.  
  357. static short int PGGen15[] = 
  358. {        -1, 0, 0, 0, -1, 0, 0, 0, 1, 
  359.         0, -1, 0, 1, 0, 0, 0, 0, 1,
  360.         -1, 0, 0, 0, 1, 0, 0, 0, -1,
  361.         -1, 0, 0, 0, -1, 0, 0, 0, -1
  362. };
  363.  
  364. static short int PGGen16[] = 
  365. {        0, -1, 0, 1, -1, 0, 0, 0, 1 
  366. };
  367.  
  368. static short int PGGen17[] = 
  369. {        0, -1, 0, 1, -1, 0, 0, 0, 1, 
  370.         -1, 1, 0, -1, 0, 0, 0, 0, 1
  371. };
  372.  
  373. static short int PGGen18[] = 
  374. {        0, -1, 0, 1, -1, 0, 0, 0, 1, 
  375.         0, -1, 0, -1, 0, 0, 0, 0, -1
  376. };
  377.  
  378. static short int PGGen19[] = 
  379. {        0, -1, 0, 1, -1, 0, 0, 0, 1, 
  380.         0, -1, 0, -1, 0, 0, 0, 0, 1
  381. };
  382.  
  383. static short int PGGen20[] = 
  384. {        0, -1, 0, 1, -1, 0, 0, 0, 1, 
  385.         0, -1, 0, -1, 0, 0, 0, 0, -1,
  386.         -1, 0, 0, 0, -1, 0, 0, 0, -1
  387. };
  388.  
  389. static short int PGGen21[] = 
  390. {        0, -1, 0, 1, -1, 0, 0, 0, 1, 
  391.         -1, 0, 0, 0, -1, 0, 0, 0, 1
  392. };
  393.  
  394. static short int PGGen22[] = 
  395. {        0, -1, 0, 1, -1, 0, 0, 0, 1, 
  396.         1, 0, 0, 0, 1, 0, 0, 0, -1
  397. };
  398.  
  399. static short int PGGen23[] = 
  400. {        0, -1, 0, 1, -1, 0, 0, 0, 1, 
  401.         -1, 0, 0, 0, -1, 0, 0, 0, 1,
  402.         -1, 0, 0, 0, -1, 0, 0, 0, -1
  403. };
  404.  
  405. static short int PGGen24[] = 
  406. {        0, -1, 0, 1, -1, 0, 0, 0, 1, 
  407.         -1, 0, 0, 0, -1, 0, 0, 0, 1,
  408.         0, 1, 0, 1, 0, 0, 0, 0, -1
  409. };
  410.  
  411. static short int PGGen25[] = 
  412. {        0, -1, 0, 1, -1, 0, 0, 0, 1, 
  413.         -1, 0, 0, 0, -1, 0, 0, 0, 1,
  414.         0, -1, 0, -1, 0, 0, 0, 0, 1
  415. };
  416.  
  417. static short int PGGen26[] = 
  418. {        0, -1, 0, 1, -1, 0, 0, 0, 1, 
  419.         1, 0, 0, 0, 1, 0, 0, 0, -1,
  420.         0, -1, 0, -1, 0, 0, 0, 0, 1
  421. };
  422.  
  423. static short int PGGen27[] = 
  424. {        0, -1, 0, 1, -1, 0, 0, 0, 1, 
  425.         -1, 0, 0, 0, -1, 0, 0, 0, 1,
  426.         0, 1, 0, 1, 0, 0, 0, 0, -1,
  427.         -1, 0, 0, 0, -1, 0, 0, 0, -1
  428. };
  429.  
  430. static short int PGGen28[] = 
  431. {        -1, 0, 0, 0, -1, 0, 0, 0, 1, 
  432.         -1, 0, 0, 0, 1, 0, 0, 0, -1,
  433.         0, 0, 1, 1, 0, 0, 0, 1, 0
  434. };
  435.  
  436. static short int PGGen29[] = 
  437. {        -1, 0, 0, 0, -1, 0, 0, 0, 1, 
  438.         -1, 0, 0, 0, 1, 0, 0, 0, -1,
  439.         0, 0, 1, 1, 0, 0, 0, 1, 0,
  440.         -1, 0, 0, 0, -1, 0, 0, 0, -1
  441. };
  442.  
  443. static short int PGGen30[] = 
  444. {        -1, 0, 0, 0, -1, 0, 0, 0, 1, 
  445.         -1, 0, 0, 0, 1, 0, 0, 0, -1,
  446.         0, 0, 1, 1, 0, 0, 0, 1, 0,
  447.         0, 1, 0, 1, 0, 0, 0, 0, -1
  448. };
  449.  
  450. static short int PGGen31[] = 
  451. {        -1, 0, 0, 0, -1, 0, 0, 0, 1, 
  452.         -1, 0, 0, 0, 1, 0, 0, 0, -1,
  453.         0, 0, 1, 1, 0, 0, 0, 1, 0,
  454.         0, 1, 0, 1, 0, 0, 0, 0, 1
  455. };
  456.  
  457. static short int PGGen32[] = 
  458. {        -1, 0, 0, 0, -1, 0, 0, 0, 1, 
  459.         -1, 0, 0, 0, 1, 0, 0, 0, -1,
  460.         0, 0, 1, 1, 0, 0, 0, 1, 0,
  461.         0, 1, 0, 1, 0, 0, 0, 0, -1,
  462.         -1, 0, 0, 0, -1, 0, 0, 0, -1
  463. };
  464.  
  465.  
  466. void laden(void) {
  467.  
  468.        if (strcmp(PGr,     "1") == 0) Klasse =  1;
  469.        if (strcmp(PGr,    "-1") == 0) Klasse =  2;
  470.        if (strcmp(PGr,     "2") == 0) Klasse =  3;
  471.        if (strcmp(PGr,     "m") == 0) Klasse =  4;
  472.        if (strcmp(PGr,   "2/m") == 0) Klasse =  5;
  473.        if (strcmp(PGr,   "222") == 0) Klasse =  6;
  474.        if (strcmp(PGr,   "mm2") == 0) Klasse =  7;
  475.        if (strcmp(PGr,   "mmm") == 0) Klasse =  8;
  476.        if (strcmp(PGr,     "4") == 0) Klasse =  9;
  477.        if (strcmp(PGr,    "-4") == 0) Klasse = 10;
  478.        if (strcmp(PGr,   "4/m") == 0) Klasse = 11;
  479.        if (strcmp(PGr,   "422") == 0) Klasse = 12;
  480.        if (strcmp(PGr,   "4mm") == 0) Klasse = 13;
  481.        if (strcmp(PGr,  "-42m") == 0) Klasse = 14;
  482.        if (strcmp(PGr, "4/mmm") == 0) Klasse = 15;
  483.        if (strcmp(PGr,     "3") == 0) Klasse = 16;
  484.        if (strcmp(PGr,    "-3") == 0) Klasse = 17;
  485.        if (strcmp(PGr,    "32") == 0) Klasse = 18;
  486.        if (strcmp(PGr,    "3m") == 0) Klasse = 19;
  487.        if (strcmp(PGr,   "-3m") == 0) Klasse = 20;
  488.        if (strcmp(PGr,     "6") == 0) Klasse = 21;
  489.        if (strcmp(PGr,    "-6") == 0) Klasse = 22;
  490.        if (strcmp(PGr,   "6/m") == 0) Klasse = 23;
  491.        if (strcmp(PGr,   "622") == 0) Klasse = 24;
  492.        if (strcmp(PGr,   "6mm") == 0) Klasse = 25;
  493.        if (strcmp(PGr,  "-62m") == 0) Klasse = 26;
  494.        if (strcmp(PGr, "6/mmm") == 0) Klasse = 27;
  495.        if (strcmp(PGr,    "23") == 0) Klasse = 28;
  496.        if (strcmp(PGr,   "m-3") == 0) Klasse = 29;
  497.        if (strcmp(PGr,   "432") == 0) Klasse = 30;
  498.        if (strcmp(PGr,  "-43m") == 0) Klasse = 31;
  499.        if (strcmp(PGr,  "m-3m") == 0) Klasse = 32;
  500.  
  501.  
  502. /* Definitionstabelle der Punktgruppen */
  503.  
  504.        switch (Klasse) {
  505.                case  1 :       /* (1)  1 */
  506.                                MatAnz = 0;
  507.                                krsys = 1;
  508.                                break;
  509.  
  510.                case  2 :       /* (2)  -1 */
  511.                                MatAnz = 1;
  512.                                krsys = 1;
  513.                                PGMat = &PGGen2[0];
  514.                                break;
  515.  
  516.                case  3 :       /* (3)  2 */
  517.                                MatAnz = 1;
  518.                                krsys = 2;
  519.                                PGMat = &PGGen3[0];
  520.                                break;
  521.  
  522.                case  4 :       /* (4)  m */
  523.                                MatAnz = 1;
  524.                                krsys = 2;
  525.                                PGMat = &PGGen4[0];
  526.                                break;
  527.  
  528.                case  5 :       /* (5)  2/m */
  529.                                MatAnz = 2;
  530.                                krsys = 2;
  531.                                PGMat = &PGGen5[0];
  532.                                break;
  533.  
  534.                case  6 :       /* (6)  222 */
  535.                                MatAnz = 2;
  536.                                krsys = 3;
  537.                                PGMat = &PGGen6[0];
  538.                                break;
  539.  
  540.                case  7 :       /* (7)  mm2 */
  541.                                MatAnz = 2;
  542.                                krsys = 3;
  543.                                PGMat = &PGGen7[0];
  544.                                break;
  545.  
  546.                case  8 :       /* (8)  mmm */
  547.                                MatAnz = 3;
  548.                                krsys = 3;
  549.                                PGMat = &PGGen8[0];
  550.                                break;
  551.  
  552.                case  9 :       /* (9)  4 */
  553.                                MatAnz = 2;
  554.                                krsys = 4;
  555.                                PGMat = &PGGen9[0];
  556.                                break;
  557.  
  558.                case 10 :       /* (10)  -4 */
  559.                                MatAnz = 2;
  560.                                krsys = 4;
  561.                                PGMat = &PGGen10[0];
  562.                                break;
  563.  
  564.                case 11 :       /* (11)  4/m */
  565.                                MatAnz = 3;
  566.                                krsys = 4;
  567.                                PGMat = &PGGen11[0];
  568.                                break;
  569.  
  570.                case 12 :       /* (12)  422 */
  571.                                MatAnz = 3;
  572.                                krsys = 4;
  573.                                PGMat = &PGGen12[0];
  574.                                break;
  575.  
  576.                case 13 :       /* (13)  4mm */
  577.                                MatAnz = 3;
  578.                                krsys = 4;
  579.                                PGMat = &PGGen13[0];
  580.                                break;
  581.  
  582.                case 14 :       /* (14)  -42m */
  583.                                MatAnz = 3;
  584.                                krsys = 4;
  585.                                PGMat = &PGGen14[0];
  586.                                break;
  587.  
  588.                case 15 :       /* (15)  4/mmm */
  589.                                MatAnz = 4;
  590.                                krsys = 4;
  591.                                PGMat = &PGGen15[0];
  592.                                break;
  593.  
  594.                case 16 :       /* (16)  3 */
  595.                                MatAnz = 1;
  596.                                krsys = 5;
  597.                                PGMat = &PGGen16[0];
  598.                                break;
  599.  
  600.                case 17 :       /* (17)  -3 */
  601.                                MatAnz = 2;
  602.                                krsys = 5;
  603.                                PGMat = &PGGen17[0];
  604.                                break;
  605.  
  606.                case 18 :       /* (18) 32 */
  607.                                MatAnz = 2;
  608.                                krsys = 5;
  609.                                PGMat = &PGGen18[0];
  610.                                break;
  611.  
  612.                case 19 :       /* (19)  3m */
  613.                                MatAnz = 2;
  614.                                krsys = 5;
  615.                                PGMat = &PGGen19[0];
  616.                                break;
  617.  
  618.                case 20 :       /* (20)  -3m */
  619.                                MatAnz = 3;
  620.                                krsys = 5;
  621.                                PGMat = &PGGen20[0];
  622.                                break;
  623.  
  624.                case 21 :       /* (21)  6 */
  625.                                MatAnz = 2;
  626.                                krsys = 6;
  627.                                PGMat = &PGGen21[0];
  628.                                break;
  629.  
  630.                case 22 :       /* (22)  -6 */
  631.                                MatAnz = 2;
  632.                                krsys = 6;
  633.                                PGMat = &PGGen22[0];
  634.                                break;
  635.  
  636.                case 23 :       /* (23)  6/m */
  637.                                MatAnz = 3;
  638.                                krsys = 6;
  639.                                PGMat = &PGGen23[0];
  640.                                break;
  641.  
  642.                case 24 :       /* (24)  622 */
  643.                                MatAnz = 3;
  644.                                krsys = 6;
  645.                                PGMat = &PGGen24[0];
  646.                                break;
  647.  
  648.                case 25 :       /* (25)  6mm */
  649.                                MatAnz = 3;
  650.                                krsys = 6;
  651.                                PGMat = &PGGen25[0];
  652.                                break;
  653.  
  654.                case 26 :       /* (26) -6m2 */
  655.                                MatAnz = 3;
  656.                                krsys = 6;
  657.                                PGMat = &PGGen26[0];
  658.                                break;
  659.  
  660.                case 27 :       /* (27)  6/mmm */
  661.                                MatAnz = 4;
  662.                                krsys = 6;
  663.                                PGMat = &PGGen27[0];
  664.                                break;
  665.  
  666.                case 28 :       /* (28)  23 */
  667.                                MatAnz = 3;
  668.                                krsys = 7;
  669.                                PGMat = &PGGen28[0];
  670.                                break;
  671.  
  672.                case 29 :       /* (29)  m-3 */
  673.                                MatAnz = 4;
  674.                                krsys = 7;
  675.                                PGMat = &PGGen29[0];
  676.                                break;
  677.  
  678.                case 30 :       /* (30)  432 */
  679.                                MatAnz = 4;
  680.                                krsys = 7;
  681.                                PGMat = &PGGen30[0];
  682.                                break;
  683.  
  684.                case 31 :       /* (31)  -43m */
  685.                                MatAnz = 4;
  686.                                krsys = 7;
  687.                                PGMat = &PGGen31[0];
  688.                                break;
  689.  
  690.                case 32 :       /* (32)  m-3m */
  691.                                MatAnz = 5;
  692.                                krsys = 7;
  693.                                PGMat = &PGGen32[0];
  694.  
  695.        }
  696.  
  697.  
  698.  
  699.  
  700.                                /* Generatormatrix erzeugen */
  701.  
  702.    if (MatAnz > 0) 
  703.     { for (h = 0; h < MatAnz; h++)    /* Generator laden */
  704.            { for(i = 0; i < 3; i++) 
  705.                 { for(j = 0; j < 3; j++) 
  706.                     { Generator [h][i][j] = *(PGMat+(h*9)+(i*3)+j);
  707.                     }
  708.                 }
  709.             }
  710.     }
  711. }
  712.  
  713.  
  714.